package com.spsy.pay.mq;

import com.spsy.pay.constant.LxConstant;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * @Author: Kyrie Irving
 * @Date: 2025/10/8 11:44
 * @Description:
 **/
@RestController
@RequestMapping("lxmq")
public class LxMqSend {

    @Autowired
    private RabbitTemplate rabbitTemplate;
    @PostMapping("/send")
    public void send(){
        CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
        rabbitTemplate.convertAndSend(LxConstant.LxExchange,LxConstant.LxRouting,"++测试++",correlationData);
    }
}
